import java.util.Scanner;
public class 计算图形面积 {
        public static void main(String[] args) {
            rectangle();
        }

        public static void rectangle() {
            Scanner scanner = new Scanner(System.in);
            System.out.println("长方形的长：");
            double b = scanner.nextDouble();
            System.out.println("长方形的宽：");
            double a = scanner.nextDouble();
            double S = a * b;
            System.out.println(S);
        }
        public static void square() {
            Scanner scanner = new Scanner(System.in);
            System.out.println("正方形的边长：");
            double x = scanner.nextDouble();
            double S = x * x;
            System.out.println(S);
        }
        public static void triangle() {
            Scanner scanner = new Scanner(System.in);
            System.out.println("三角形的高：");
            double h = scanner.nextDouble();
            System.out.println("三角形的底：");
            double a = scanner.nextDouble();
            double S = 1 / 2 * a * h;
            System.out.println(S);

        }
    }


